﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpWeb
{
    /// <summary>
    /// 页面组件的基类,未在派生类中重写时表示一个一般的Html页面
    /// </summary>
    public class HtmlTag : AbstractContainerTagComponent
    {
        public HtmlTag()
        {

        }
        #region 属性
        protected override string TagName
        {
            get { return "html"; }
        }

        protected override bool CloseItSelf
        {
            get { return false; }
        }

        private HeadTag _Head;
        /// <summary>
        /// Head标签
        /// </summary>
        public HeadTag Head
        {
            get { return _Head; }
        }

        private BodyTag _Body;
        /// <summary>
        /// Body标签
        /// </summary>
        public BodyTag Body
        {
            get { return _Body; }
        }

        #endregion
        #region 方法

        protected override void InitComponent(ComponentContext context)
        {
            base.InitComponent(context);
            this._Head = new HeadTag();
            this._Body = new BodyTag();
            this.Children.Add(this.Head);
            this.Children.Add(this.Body);
        }

        #endregion
    }
}
